class UnknownTemp(object):
	def __str__(self):
		return "Unknown"
UnknownTemp = UnknownTemp()

class Temperature(object):
	def __init__(self, temp=UnknownTemp):
		"""
			temp - 
				a number value is in fahrenheit
				a string with just a number in it is in fahrenheit
				a string ending with 'c' or 'C' is in celsius
		"""
		if isinstance(temp, basestring):
			if temp.endswith("c") or temp.endswith("C"):
				self.temp = float(temp) * 1.8 + 32
			else:
				self.temp = float(temp)
		else:
			self.temp = float(temp)

	def __str__(self):
		return "%s F" % self.temp
	
	def f(self):
		return self.Fahrenheit()
	
	def c(self):
		return self.Celsius()
	
	def Fahrenheit(self):
		return self.temp
	
	def Celsius(self):
		return (self.temp - 32) / 1.8
